home *** CD-ROM | disk | FTP | other *** search
- Path: holly.ACNS.ColoState.EDU!not-for-mail
- From: corbyh@holly.ACNS.ColoState.EDU (Corby S. Hudnall)
- Newsgroups: comp.lang.c++
- Subject: Re: one character input?
- Date: 16 Apr 1996 19:04:29 -0600
- Organization: Colorado State University, Fort Collins, CO 80523
- Message-ID: <4l1g2t$1aoo@holly.ACNS.ColoState.EDU>
- References: <3173AAF0.3515@struct.kth.se>
- NNTP-Posting-Host: holly.acns.colostate.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Peter Andren wrote:
- : Hello,
-
- : I need a function to read one character from the keyboard without to end
- : the input with a returncharacter. Unfortunatly I'm not able to find this
- : funtion in my book, but I have a strong feeling that it shouldn't be so
- : difficult.
-
- Not sure exactly what you want but have you tried the get function. Use
- it like so:
- char temp;
- cin.get(temp);
- This will get one character at a time and place it into temp. Easy right?
-
- // ------------ BEGIN SIGNATURE ---------------
- #include <iostream.h>
- void main(void)
- {
- cout << "\aName:\tCorby S. Hudnall\n"
- << "School:\tColorado State University\n"
- << "\tDepartement of Computer Science\n"
- << "EMail:\thudnall@CS.ColoState.EDU\n"
- << "URL:\thttp://WWW.CS.ColoState.EDU/~hudnall\n";
- }
- // ------------ END SIGNATURE -----------------
-
-